package addconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AddConfig struct {
	QiNiuYUNConfig
	ALiYUNConfig
	JwtConfig
}
type QiNiuYUNConfig struct {
	AccessKey string
	SecretKey string
}
type ALiYUNConfig struct {
	AccessKeyID     string
	AccessKeySecret string
}
type JwtConfig struct {
	AccessSecret string
	AccessExpire int64
}

var AddConf AddConfig

func InitConfig() {
	viper.SetConfigFile("./addconfig/viper.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("配置读取失败", err)
		return
	}
	viper.Unmarshal(&AddConf)
	fmt.Println(AddConf)

}
